{% extends "bootstrap/base.html" %}
{% block title %}个人主页{% endblock %}  
{% block navbar %}
    <nav class="navbar navbar-inverse">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">切换导航栏</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{{url_for('main.index')}}">个人主页</a >
            </div>
            <div id="navbar" class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li><a href="{{url_for('main.index')}}">首页</a></li>
                    <li><a href="{{url_for('main.user')}}">用户</a></li>
                    {% if current_user.is_authenticated %}
                        <li><a href="#">你好呀 {{ current_user.username }}</a></li>
                        <li><a href="{{url_for('auth.logout')}}">退出登录</a></li>
                    {% else %}
                        <li><a href="{{url_for('auth.login')}}">登录</a></li>
                        <li><a href="{{url_for('auth.register')}}">注册</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>
{%endblock%}
{%block content%}
    <div class="container">
        {% for message in get_flashed_messages() %}
        <div class="alert alert-warning">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {{ message }}
        </div>
        {% endfor %}
        {% block page_content %}{% endblock %}
    </div>
{%endblock%}